#pragma once
#include "ArServerMode.h"
#include "ArServerClient.h"
#include "ariaTypedefs.h"
class AxServerModelGotoPoseLimit: public ArServerMode
{
public:
	AxServerModelGotoPoseLimit(ArServerBase *server, ArRobot *robot, 	ArPose home = ArPose(0, 0, 0), 	ArRetFunctor<ArPose> *getHomePoseCB = NULL);
	~AxServerModelGotoPoseLimit(void);
	ArPose myGoalPose;
	bool myDone;
	ArActionGoto*   myGotoAction;
	ArActionGroup myRatioDriveGroup;

	ArActionDeceleratingLimiter *myLimiterForward;
	ArActionDeceleratingLimiter *myLimiterBackward;
	ArActionDeceleratingLimiter *myLimiterLateralLeft;
	ArActionDeceleratingLimiter *myLimiterLateralRight;
	ArActionLimiterForwards *limiterAction;
	ArActionLimiterForwards *limiterFarAction;
	ArActionLimiterBackwards *limiterBackwardsAction;

protected:
	void serverGetGoals(ArServerClient *client,ArNetPacket *packet);
	void serverGotoPose(ArServerClient *client,ArNetPacket *packet);

	virtual void activate(void);

	virtual void deactivate(void);

	virtual void userTask(void);

	ArFunctor2C<AxServerModelGotoPoseLimit, ArServerClient *, ArNetPacket *> myServerGotoPoseCB;
};

